﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="middle-column.ascx.cs" Inherits="templates_client_usercontrols_middle_cloumn" %>

<%@ Register TagPrefix="vst" TagName="RateSecurities" Src="~/templates/client/usercontrols/rate-securities.ascx" %>
<script language="javascript">
    function catchuoi(str,n)
    {    
         var s=""; 
         var stringSplitArray = str.split(" ");

         var j = 0;
         if(n> stringSplitArray.length)
         {
            s= str;
         }
         else
         {
             for(j = 0; j < n; j++)
             {
               s= s + stringSplitArray[j] + " ";
             }
             s = s+ "...";
         }
         document.write(s);
    }
</script>
<!-- Begin rate securities -->
    <vst:RateSecurities ID="ratesecurities" runat="server" />
<!-- Begin rate securities -->

<!-- Begin page content--> 
<!-- Begin news -->
<asp:Repeater ID="rptdanhmuccha" runat="server" DataSourceID="SqlDataSourceDanhMucCha">
    <ItemTemplate>
      <table style="margin-top:1px; width:504px;" cellpadding="0" cellspacing="0">
        <tr style="background-image:url(../templates/client/images/bar_title_middle.png); background-repeat:no-repeat; height:35px;">
            <td valign="top" align="left">
                <img src="../templates/client/images/arrow_title.png" alt="arrow_title" width="20px" style="margin-left:5px; margin-right:5px; margin-top:7px;" />
                <span class="title_bar_content" style="margin-top:10px;"><%#Eval("Ten")%></span>
                <asp:Label ID="idchuyenmuc" runat="server" Text='<%# Eval("Id") %>' Visible="False" />
            </td>
        </tr>
        <tr>
            <td>
               <div class="usual">                    
                   <ul class="idTabs">
                        <asp:Repeater ID="rptdanhmuccon" runat="server" DataSourceID="SqlDataSourceDanhMucCon" >                         
                            <ItemTemplate>
                                <li><a  href='<%# "#" + Eval("Id")%>'><%#Eval("Ten")%></a></li>                                
                            </ItemTemplate>                                                    
                        </asp:Repeater> 
                    </ul>
                     <asp:SqlDataSource ID="SqlDataSourceDanhMucCon" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                        SelectCommand="Proc_DanhMuc_SelectDanhMucTinTucCon" SelectCommandType="StoredProcedure">
                        <SelectParameters>
                        <asp:ControlParameter ControlID="idchuyenmuc" Name="id" PropertyName="Text" Type="Int32" />
                        </SelectParameters>
                        </asp:SqlDataSource>
                      
                        <asp:Repeater ID="rptdanhmuctintuc" runat="server" DataSourceID="SqlDataSourceDanhMucCon" >                         
                            <ItemTemplate>
                                <div style="display: none;" id="<%# Eval("Id") %>">                                 
                                <asp:Label ID="idchuyenmuccon" runat="server" Text='<%# Eval("Id") %>' Visible="False" />                            
                                 <asp:Repeater ID="rpttop1news" runat="server" DataSourceID="SqlDataSourceTop1TinTuc">
                                        <ItemTemplate>                                          
                                            <table border="0" cellpadding="0" cellspacing="0">
                                            <tr>
                                                <td style="border-right:dotted 1px #00CCFF" valign="top" align="left">
                                                     <p class="title_news"><script type="text/javascript" language="javascript"> catchuoi('<%# Eval("TieuDe") %>', 9);</script></p>
                                                          <span class="create_date">Ngày đăng:<%#Eval("NgayDang")%> bởi <%#Eval("TenDangNhap") %></span><br />
                                                            <ul>
                                                                <li class="images_news_home">
                                                                    <img src="<%#"../uploads/imagenewsupload/" + Eval("HinhAnh")%>"<" alt="hình" />        
                                                                </li>
                                                            </ul>
                                                           <span>
                                                                <%#Eval("TomTat") %>
                                                            </span><br />
                                                      <a href="<%# "chitiettintuc.aspx?news="+Eval("Id")+"&category="+Eval("ChuyenMuc")%>" class="link_detail">Chi tiết >></a>
                                                </td>
                                                <td width="180px" valign="top" align="left" style="padding-left:5px;">
                                                    <p class="title_news">Tin cũ hơn</p>                                                                                                        
                                                    <ul class="other_news">
                                                        <asp:Repeater ID="rpttop6" runat="server" DataSourceID="SqlDataSourceTop6TinTuc">
                                                            <ItemTemplate>
                                                               <li>
                                                                <a href="<%# "chitiettintuc.aspx?news="+Eval("Id")+"&category="+Eval("ChuyenMuc")%>" onmouseout="hidetip();" onmouseover="showtip('<p style=\'margin:0 0 0 10px; font:bold 15px Arial, Helvetica, sans-serif; color:#0066ff\'><%# Eval("TieuDe") %></p><span style=\' margin-left:10px; font:italic 11px Arial, Helvetica, sans-serif; color:#00CCff\'>Đăng ngày: <%# Eval("NgayDang") %> bởi <%# Eval("TenDangNhap") %>></span><br /><ul style=\'float:left\'><li style=\'background:url(../templates/client/images/bg_img_news_home.png) no-repeat; width:120px; height:100px; margin:0px 10px 0px -30px ; display:inline-table\'><img src=\'<%#"../uploads/imagenewsupload/" + Eval("HinhAnh")%>\' alt=\'hình\' style=\'width:110px; height:88px; margin:5px 0px 0px 5px;\' /></li></ul><div><%#Eval("TomTat") %></div>');">
                                                                 <script type="text/javascript" language="javascript"> catchuoi('<%# Eval("TieuDe") %>',7);</script>   
                                                                </a>
                                                               </li>
                                                            </ItemTemplate>
                                                        </asp:Repeater>
                                                        <asp:SqlDataSource ID="SqlDataSourceTop6TinTuc" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                                                        SelectCommand="Proc_DanhMuc_SelectTop6TinTuc" SelectCommandType="StoredProcedure">
                                                        <SelectParameters>
                                                            <asp:ControlParameter ControlID="idchuyenmuccon" Name="id" PropertyName="Text" Type="Int32" />
                                                        </SelectParameters>
                                                        </asp:SqlDataSource>                                      
                                                    </ul>                                                    
                                                </td>
                                            </tr>
                                        </table>
                                       
                                        </ItemTemplate>                                                             
                                    </asp:Repeater>
                                    <asp:SqlDataSource ID="SqlDataSourceTop1TinTuc" runat="server" ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
                                    SelectCommand="Proc_DanhMuc_SelectTop1TinTuc" SelectCommandType="StoredProcedure">
                                    <SelectParameters>
                                        <asp:ControlParameter ControlID="idchuyenmuccon" Name="id" PropertyName="Text" Type="Int32" />
                                    </SelectParameters>
                                    </asp:SqlDataSource>
                                    </div>                              
                           </ItemTemplate>                                                    
                        </asp:Repeater>                        
                 </div>
            </td>
        </tr>
        <tr style="background-image:url(../templates/client/images/footer-page-content2.png); background-repeat:repeat-x; height:40px">
        <td>&nbsp;</td>
        </tr>
      </table>  
      
    </ItemTemplate>    
</asp:Repeater>
<asp:SqlDataSource ID="SqlDataSourceDanhMucCha" runat="server" 
    ConnectionString="<%$ ConnectionStrings:ConnectionString %>" 
    SelectCommand="Proc_DanhMuc_SelectDanhMucTinTucCha" 
    SelectCommandType="StoredProcedure">
</asp:SqlDataSource> 